home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Windows
/
StrangeWindow.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
2KB
|
104 lines
// StrangeWindow.cp
#ifndef StrangeWindow_h
#include "StrangeWindow.h"
#endif
#ifndef WindowUpdater_h
#include "WindowUpdater.h"
#endif
#ifndef MouseDownEvent_h
#include "MouseDownEvent.h"
#endif
#ifndef GrayRegion_h
#include "GrayRegion.h"
#endif
#ifndef SplitIntegers_h
#include "SplitIntegers.h"
#endif
#ifndef RegionObject_h
#include "RegionObject.h"
#endif
#ifndef CursorObject_h
#include "CursorObject.h"
#endif
void StrangeWindow::Update()
{
Assert( window != 0 );
WindowUpdater updater( *window );
}
void StrangeWindow::Activate()
{
Assert( window != 0 );
}
void StrangeWindow::Deactivate()
{
Assert( window != 0 );
}
void StrangeWindow::ClickContent( const MouseDownEvent& )
{
Assert( window != 0 );
if ( !window->IsFrontmost() )
SelectWindow( &window->Port() );
}
void StrangeWindow::ClickDrag( const MouseDownEvent& click )
{
Assert( window != 0 );
if ( !window->IsFrontmost() && !click.Command() )
SelectWindow( &window->Port() );
Rectangle bounds = GrayRegion::The().Bounds();
DragWindow( &window->Port(), click.GlobalPoint(), &bounds );
}
void StrangeWindow::ClickClose( const MouseDownEvent& click )
{
Assert( window != 0 );
Assert( window->IsFrontmost() );
if ( TrackGoAway( &window->Port(), click.GlobalPoint() ) )
HideWindow( &window->Port() );
}
void StrangeWindow::ClickZoomIn( const MouseDownEvent& click )
{
Assert( window != 0 );
Assert( window->IsFrontmost() );
if ( TrackBox( &window->Port(), click.GlobalPoint(), inZoomIn ) )
ZoomWindow( &window->Port(), inZoomIn, true );
}
void StrangeWindow::ClickZoomOut( const MouseDownEvent& click )
{
Assert( window != 0 );
Assert( window->IsFrontmost() );
if ( TrackBox( &window->Port(), click.GlobalPoint(), inZoomOut ) )
ZoomWindow( &window->Port(), inZoomOut, true );
}
void StrangeWindow::ClickGrow( const MouseDownEvent& click )
{
Assert( window != 0 );
Assert( window->IsFrontmost() );
static const Rect limits = { 64, 64, maxint16, maxint16 };
uint32 result = GrowWindow( &window->Port(), click.GlobalPoint(), &limits );
if ( result != 0 )
SizeWindow( &window->Port(), Word0( result ), Word1( result ), true );
}
const CursorObject& StrangeWindow::Cursor( const MouseEvent&,
RegionObject& sleep )
{
sleep = Rectangle::big;
return CursorObject::Arrow();
}